#ifndef NETWORKBOT_H
#define NETWORKBOT_H

#include <QTcpServer>
#include <QTcpSocket>

#include "thinkerbot.h"

class NetworkBot : public ThinkerBot
{
    Q_OBJECT

public:
    NetworkBot();

protected:

    virtual void handleStateChange();

private slots:
    void newSession();
    void newCommand();
    void sessionClosed();

private:
    void initService();
    void initSession();
    bool sendShoot();
    bool sendCommand(const QString &cmd);


    void cmdShoot(int force, int angle);

    QTcpServer  mService;
    QTcpSocket *mSession;
    int         mBotId;
    QByteArray  mSessionData;
};

#endif // NETWORKBOT_H
